package Engine;

import java.sql.Connection;
import java.sql.ResultSet;
import java.util.ArrayList;

import java.sql.PreparedStatement;

import Engine.util.JdbcConnection;


public class Realms {
	private ArrayList realms = new ArrayList();
	public Realms newInstance() throws Exception {
		Connection conn = new JdbcConnection().getConnection();
		PreparedStatement pst = conn.prepareStatement("Select realm from wow_data.realm_list");
		ResultSet rs = pst.executeQuery();
		while(rs.next()) {
			realms.add((String)rs.getString("realm"));
		}
		conn.close();
		return this;
	}
	
	public ArrayList getRealms() {
		return realms;
	}
}
